﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VipCo.Data;
using VipCo.Entities;

public partial class HomePage : System.Web.UI.MasterPage
{
    public string yahooId;
    public string skypeId;
    public string facebook;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HienthiContact();
            if (Session["TP"] == null)
            {
                Session["TP"] = Common.TP_Danang;
            }
        }
    }

    public void HienthiContact()
    {
        TList<LienLac> tlistLl = DataRepository.LienLacProvider.GetAll();
        if (tlistLl.Count() > 0)
        {
            foreach (var lienLac in tlistLl)
            {
                if (lienLac.Name.Equals("Phone"))
                {
                    litPhone.Text = lienLac.Value;
                }
                if (lienLac.Name.Equals("Yahoo"))
                {
                    yahooId = lienLac.Value;
                }
                if (lienLac.Name.Equals("Skype"))
                {
                    skypeId = lienLac.Value;
                }
                if (lienLac.Name.Equals("Facebook"))
                {
                    facebook = lienLac.Value;
                }
            }
        }

    }
}
